package com.tiger.cloud.enums;

import com.tiger.cloud.common.mybatis.handler.CodeEnum;

/**
 * 通用枚举类型
 */
public enum LoanRecordType implements CodeEnum<LoanRecordType> {

	CAR_MORTGAGE(1, "车辆抵押"), NO_MORTGAGE(2, "无抵押"), BRIDGE(3, "零用贷"), ADVANCE_MONEY(4, "垫资空放"), IMMOVABLE_PROPERTY(5, "不动产抵押"), OTHER_PROPERTY(6, "其他抵押"),EMPTY(7, "无效");

	private int code;
	private String desc;

	private LoanRecordType(int code, String desc) {
		this.code = code;
	}

	/**
     * 通过枚举<code>name</code>获取枚举
     */
    public static LoanRecordType getEnumByCode(Integer code) {
    	if(code==null){
    		return null;
    	}
        for (LoanRecordType enumm : LoanRecordType.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }
    
	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}
